/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-20 10:47:33
 * @LastEditTime: 2022-03-18 14:42:07
 * @LastEditors: Please set LastEditors
 * @Description: 养殖品种管理接口 sheep-information
 */
import xjaxios from "@/api/axios";

export default {
  /**
   * @description: 获取养殖品种列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getList(params) {
    return xjaxios.post("breedTemplate/breedVariety/queryPageByCondition", params);
  },

  getSheepBirthRecordList(params) {
    return xjaxios.post('/breedTemplate/breedVariety/queryPageGenerateRecordsPageParam', params)
  },
  // /**
  //  * @description: 条件查询所有养殖品种
  //  * @param null *
  //  * @return {Object}
  //  */
  getByCondition(params) {
    return xjaxios.post("breedTemplate/breedVariety/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      ...params
    });
  },
  getByNo(no) {
    return xjaxios.get(`breedTemplate/breedVariety/queryByNo?no=${no}`);
  },
  // /**
  //  * @description: 条件查询所有养殖品种
  //  * @param null *
  //  * @return {Object}
  //  */
  getStaffListByCondition(params) {
    return xjaxios.post("organization/personDepartmentMapper/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      personNo: params
    });
  },
  // /**
  //  * @description: 条件查询所有栋舍
  //  * @param null *
  //  * @return {Object}
  //  */
  getfacilityByCondition(params) {
    return xjaxios.post("breedFacility/facility/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      ...params
    });
  },
  /**
   * @description: 新增养殖品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  add(formData) {
    // formData.organizationNo = sessionStorage.baseId;
    return xjaxios.post("breedTemplate/breedVariety/add", {
      organizationNo: sessionStorage.organizationNo,
      ...formData
    });
  },
  /**
   * @description: 编辑养殖品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  edit(formData) {
    return xjaxios.post("breedTemplate/breedVariety/edit", formData);
  },
  /**
   * @description: 单个删除
   * @param {String} employeeId *
   * @return {Array}
   */
  del(no) {
    return xjaxios.get(`breedTemplate/breedVariety/delByNo?no=${no}`);
  },
  delList(noList) {
    return xjaxios.post(`breedTemplate/breedVariety/delListByNo`, { noList: noList });
  },
  // 上传excel
  employeeImportExcel(fileFormData) {
    return xjaxios.post('breedTemplate/breedVariety/xlsUpdate', fileFormData)
  },
  // 下载excel
  employeeExpensesDownExcel(params) {
    return xjaxios.post("organization/employee/downExcel", params, { responseType: 'arraybuffer' });
  },
  // 种样选留记录查询
  querySelectRetainRecord(params) {
    return xjaxios.post('/breedTemplate/breedVariety/querySelectRetainRecord', params)
  },
  // 种羊修改
  editBreedSheep(params) {
    return xjaxios.post('/breedTemplate/breedVariety/editBreedSheep', params)
  },
  getColectPicture(params) {
    return xjaxios.get(`/breedTemplate/breedVarietyPicture/queryByNo?no=${params}&organizationNo=${sessionStorage.organizationNo}`)
  },
  delCollectionPicture(params) {
    return xjaxios.get(`/breedTemplate/breedVarietyPicture/delByNo?no=${params}&organizationNo=${sessionStorage.organizationNo}`)
  }
};
